<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_member.*" %>
<%@page import="java.util.*" %>

<%@page import="com.lmpop.frame.util.PageTools" %>
<%@page import="com.lmpop.trade.ts_area.*" %>

<%
	request.setCharacterEncoding("UTF-8");
		
	Map ti_member = new Hashtable();
	ti_member.put("user_class","7");
  ti_member.put("cust_type","0");	
	ti_member.put("m_state","1");	
	Ti_memberInfo ti_memberInfo = new Ti_memberInfo();
	
	String iStart = "0",biz_id="",cust_id="";
	int limit = 20;

	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	if(request.getParameter("cust_id")!=null) cust_id = request.getParameter("cust_id");
	if(request.getParameter("biz_id")!=null) biz_id = request.getParameter("biz_id");
	List list = ti_memberInfo.getListByPageCom(ti_member,Integer.parseInt(iStart),limit);
	int counter = ti_memberInfo.getCountByObjCom(ti_member);
	String pageString = new PageTools().getGoogleToolsBar(counter,"subadminindex.jsp?iStart=",Integer.parseInt(iStart),limit);
   
  Ts_areaInfo ts_areaInfo = new Ts_areaInfo();
	Map areaMap  = ts_areaInfo.getAreaClass();
	
	%>
<html>
  <head>
    
  <title>企业会员级别管理</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
	<script language="javascript" type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"></script>
	<script type="text/javascript" src="js_commen.js"></script>
	<script type="text/javascript" src="/js/commen.js"></script>
	
 
</head>

<body>
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td width="80%">
				<h1>请选择分公司</h1>
			</td>
			<td>
			     
			</td>
		</tr>
	</table>
	
	<form action="company_level.jsp" name="indexForm" method="post">
	
	

	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	
	<% 
		int listsize = 0;
		if(list!=null && list.size()>0){
			listsize = list.size();
	%>
	
		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">

			</td>
			<td>
				总计:<%=counter %>条
			</td>
		</tr>
	</table>
	
	<table width="100%" cellpadding="1" cellspacing="1" class="listtab" border="0">
		<tr>

			
		  	<th>分公司名称</th>
		  	<th>所在地</th>
		  	
		</tr>
		
		
		<% 
		  		for(int i=0;i<list.size();i++){
		  			Hashtable map = (Hashtable)list.get(i);
		  			String cust_name="",to_cust_id="",cust_type="",area_attr="";
		  			if(map.get("cust_id")!=null) to_cust_id = map.get("cust_id").toString();
						
						if(map.get("cust_name")!=null) cust_name = map.get("cust_name").toString();
						if(map.get("cust_type")!=null) cust_type = map.get("cust_type").toString();
						if(map.get("area_attr")!=null) area_attr = map.get("area_attr").toString();
						
						StringBuffer stateoutput =new StringBuffer();
						if(!area_attr.equals(""))
							{
							  String chIds[] =	area_attr.split("\\|");	
							  for(String chId:chIds)
							  {
								 if(areaMap!=null)
								 {
									 if(areaMap.get(chId)!=null)
									 {
										stateoutput.append(areaMap.get(chId).toString());                 
									  }                  
								 
								  }                 
							   }		    
							}
						
					
		  %>
		
		<tr>
 
			
		  	<td>
		  		<p>
		  			<a href="addshareinfodetail.jsp?biz_id=<%=biz_id%>&cust_id=<%=cust_id%>&to_cust_id=<%=to_cust_id%>"  style="font-size:14px;font-weight:bold;color:green"><%=cust_name%></a></p>
		  	
		  	</td>
		  	<td><%=stateoutput%></td>
		  	
		</tr>
		
		  <%
		  		}
		  %>
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">

			</td>
			<td>
				总计:<%=counter %>条
			</td>
		</tr>
	</table>
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	
	<%
		 }
	%>
	
	  

		
		</form>
</body>

</html>
